<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
  <base href="<%=basePath%>">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>添加用户</title>
  <link rel="stylesheet" type="text/css" href="css/css.css" />
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script src="js/jquery-3.6.0.js"></script>
  <script>
    function Enterprise_info_register(e){
      var formObject = {};
      var formArray =$("#form1").serializeArray();
      $.each(formArray,function(i,item){
        formObject[item.name] = item.value;
      });
      $.ajax({
        url:'Enterprise_info/register',
        headers: {
          'Content-Type': 'application/json;charset=utf-8',
        },
        type:'POST',
        data:JSON.stringify(formObject),
        dataType: "json",
        success:function(data){
          if(data.code=='1011'){
            alert("注册成功，请登录");
            window.location.href="jsp/Enterprise_login.jsp";
          }
          else if(data.code='1012') {
            alert("账号已存在，请重新输入");
            window.location.reload();
          }
          else if(data.code='1014') {
            alert("两次输入的密码不同，请重新输入");
            window.location.reload();}
          else if(data.code='1010') {
            alert("注册失败，请重试");
            window.location.reload();
          }
        }
      })
    }
  </script>
</head>
<body>
<div id="pageAll">
  <div class="pageTop">
    <div class="page">
      <img src="img/coin02.png" />企业用户注册
    </div>
  </div>
  <div class="page ">
    <!-- 会员注册页面样式 -->
    <div class="banneradd bor">
      <div class="baTopNo">
        <span>企业用户注册</span>
      </div>
      <form id="form1">
        <div class="baBody">
          <div class="bbD">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;企业名称：<input type="text" class="input3" name="soldierName" placeholder="输入企业名称:"/>
          </div>
          <div class="bbD">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;企业账号：<input type="text" class="input3" name="mobile" placeholder="输入企业账号"/>
          </div>
          <div class="bbD">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账号密码：<input type="password" class="input3" name="password" placeholder="输入密码"/>
          </div>
          <div class="bbD">
            再次输入密码：<input type="password" class="input3" name="password1" placeholder="再次输入密码" />
          </div>
          <div class="bbD">
            <p class="bbDP">
              <span class="btn_ok btn_yes" onclick="Enterprise_info_register()"><input type="hidden" />提交</span>
              <a class="btn_ok btn_no" href="jsp/Enterprise_login.jsp">取消</a>
            </p>
          </div>
        </div>
      </form>
    </div>

    <!-- 会员注册页面样式end -->
  </div>
</div>
</body>
</html>